home *** CD-ROM | disk | FTP | other *** search
Text File | 2007-10-01 | 69.0 KB | 1,589 lines |
- on(release){
- function §\x01\x02§()
- {
- return 384;
- }
- var §\x01§ = 249 + "\x01\x02"();
- loop0:
- while(true)
- {
- if(eval("\x01") == 633)
- {
- set("\x01",eval("\x01") - 413);
- §§push(true);
- continue;
- }
- if(eval("\x01") == 220)
- {
- set("\x01",eval("\x01") + 173);
- if(function §\x01\x02§()
- {
- return 384;
- })
- {
- set("\x01",eval("\x01") + 227);
- }
- continue;
- }
- if(eval("\x01") == 568)
- {
- set("\x01",eval("\x01") + 334);
- §§push(true);
- continue;
- }
- if(eval("\x01") == 284)
- {
- set("\x01",eval("\x01") + 533);
- §§push(!function §\x01\x02§()
- {
- return 384;
- });
- continue;
- }
- if(eval("\x01") == 302)
- {
- set("\x01",eval("\x01") + 528);
- §§push(true);
- continue;
- }
- if(eval("\x01") == 775)
- {
- set("\x01",eval("\x01") - 491);
- §§push(eval(function §\x01\x02§()
- {
- return 384;
- }));
- continue;
- }
- if(eval("\x01") == 697)
- {
- set("\x01",eval("\x01") - 280);
- continue;
- }
- if(eval("\x01") == 714)
- {
- set("\x01",eval("\x01") + 61);
- §§push("\x0f");
- continue;
- }
- if(eval("\x01") == 210)
- {
- set("\x01",eval("\x01") - 75);
- break;
- }
- if(eval("\x01") == 830)
- {
- set("\x01",eval("\x01") - 620);
- if(function §\x01\x02§()
- {
- return 384;
- })
- {
- set("\x01",eval("\x01") - 75);
- }
- continue;
- }
- if(eval("\x01") == 620)
- {
- set("\x01",eval("\x01") - 318);
- continue;
- }
- if(eval("\x01") == 417)
- {
- set("\x01",eval("\x01") + 183);
- §§push("\x0f");
- §§push(1);
- continue;
- }
- if(eval("\x01") != 393)
- {
- if(eval("\x01") == 817)
- {
- set("\x01",eval("\x01") - 377);
- if(function §\x01\x02§()
- {
- return 384;
- })
- {
- set("\x01",eval("\x01") + 0);
- }
- }
- else if(eval("\x01") == 600)
- {
- set("\x01",eval("\x01") + 114);
- var §§pop() = function §\x01\x02§()
- {
- return 384;
- };
- }
- else if(eval("\x01") == 135)
- {
- set("\x01",eval("\x01") + 433);
- }
- else
- {
- if(eval("\x01") == 440)
- {
- set("\x01",eval("\x01") + 350);
- _root.clickSound.start();
- gotoAndStop("instructions");
- break;
- }
- if(eval("\x01") == 702)
- {
- set("\x01",eval("\x01") - 134);
- }
- else
- {
- if(eval("\x01") == 790)
- {
- set("\x01",eval("\x01") - 790);
- break;
- }
- if(eval("\x01") == 802)
- {
- set("\x01",eval("\x01") - 500);
- }
- else if(eval("\x01") == 803)
- {
- set("\x01",eval("\x01") - 386);
- }
- else
- {
- if(eval("\x01") != 902)
- {
- if(eval("\x01") == 44)
- {
- set("\x01",eval("\x01") + 653);
- if(§§pop()[function §\x01\x02§()
- {
- return 384;
- }][§§constant(31)]() == §§constant(43))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 13;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(44))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 14;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(45))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 15;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(46))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 16;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(47))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 17;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(48))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 18;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(49))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 19;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(50))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 20;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(51))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 21;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(52))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 22;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(53))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 23;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(54))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 24;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(55))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 25;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(56))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 26;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(57))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 27;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(58))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 28;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(59))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 29;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(60))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 30;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(61))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 31;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(62))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 32;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(63))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 33;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(64))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 34;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(65))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 35;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(66))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 36;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(67))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 37;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(68))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 38;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(69))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 39;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(70))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 40;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(71))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 41;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(72))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 42;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(73))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 43;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(74))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 44;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(75))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 45;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(76))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 46;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(77))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 47;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(78))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 48;
- }
- if(_loc2_[§§constant(30)][§§constant(31)]() == §§constant(79))
- {
- _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] = 49;
- }
- _loc2_[§§constant(80)] = _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }[§§constant(29)] - 1;
- §§pop()[§§pop()] = (_global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- })[§§constant(10)](§§constant(24));
- §§constant(81)(eval("{invalid_utf8=146}=")["{invalid_utf8=255}IO"]["{P4-"],null,1);
- }
- break;
- }
- set("\x01",eval("\x01") - 858);
- if(function §\x01\x02§()
- {
- return 384;
- })
- {
- set("\x01",eval("\x01") + 653);
- }
- }
- }
- }
- continue;
- }
- set("\x01",eval("\x01") + 227);
- loop1:
- while(true)
- {
- §§push("\x0f");
- while(true)
- {
- if(eval("\x01") == 961)
- {
- set("\x01",eval("\x01") + 3);
- §§push(true);
- }
- else if(eval("\x01") == 717)
- {
- set("\x01",eval("\x01") - 471);
- §§push(eval(function §\x01\x02§()
- {
- return 384;
- }));
- }
- else if(eval("\x01") == 964)
- {
- set("\x01",eval("\x01") - 923);
- if(function §\x01\x02§()
- {
- return 384;
- })
- {
- set("\x01",eval("\x01") + 818);
- }
- }
- else
- {
- if(eval("\x01") == 41)
- {
- break loop1;
- }
- if(eval("\x01") == 859)
- {
- set("\x01",eval("\x01") - 828);
- }
- else if(eval("\x01") == 246)
- {
- set("\x01",eval("\x01") + 95);
- §§push(!function §\x01\x02§()
- {
- return 384;
- });
- }
- else if(eval("\x01") == 957)
- {
- set("\x01",eval("\x01") - 926);
- }
- else if(eval("\x01") == 31)
- {
- set("\x01",eval("\x01") + 216);
- §§push("\x0f");
- §§push(1);
- }
- else if(eval("\x01") == 247)
- {
- set("\x01",eval("\x01") + 131);
- var §§pop() = function §\x01\x02§()
- {
- return 384;
- };
- }
- else
- {
- if(eval("\x01") == 378)
- {
- break;
- }
- if(eval("\x01") == 672)
- {
- set("\x01",eval("\x01") + 248);
- Object.registerClass("message",Message);
- break loop0;
- }
- if(eval("\x01") != 341)
- {
- if(eval("\x01") == 920)
- {
- set("\x01",eval("\x01") - 920);
- }
- break loop0;
- }
- set("\x01",eval("\x01") + 331);
- if(function §\x01\x02§()
- {
- return 384;
- })
- {
- set("\x01",eval("\x01") + 0);
- }
- }
- }
- }
- set("\x01",eval("\x01") + 339);
- }
- set("\x01",eval("\x01") + 818);
- while(true)
- {
- if(function §\x01\x02§()
- {
- return 384;
- })
- {
- set("\x01",eval("\x01") + 133);
- var §§pop() = §§pop();
- }
- else if(eval("\x01") == 588)
- {
- set("\x01",eval("\x01") - 517);
- }
- else
- {
- if(eval("\x01") == 674)
- {
- set("\x01",eval("\x01") - 674);
- break loop0;
- }
- if(eval("\x01") == 326)
- {
- set("\x01",eval("\x01") + 262);
- stop();
- break loop0;
- }
- if(eval("\x01") == 928)
- {
- set("\x01",eval("\x01") + 56);
- break loop0;
- }
- if(eval("\x01") != 371)
- {
- break loop0;
- }
- set("\x01",eval("\x01") + 490);
- §§push(eval(§§pop()));
- }
- while(true)
- {
- if(eval("\x01") == 731)
- {
- set("\x01",eval("\x01") + 222);
- §§push(true);
- }
- else
- {
- if(eval("\x01") == 795)
- {
- set("\x01",eval("\x01") - 557);
- §§pop() extends §§pop() >> §§pop();
- §§pop() extends §§pop() << (§§pop() >>> §§pop());
- break loop0;
- }
- if(eval("\x01") == 979)
- {
- set("\x01",eval("\x01") - 442);
- §§push("\x0f");
- §§push(1);
- }
- else if(eval("\x01") == 953)
- {
- set("\x01",eval("\x01") - 158);
- if(§§pop())
- {
- set("\x01",eval("\x01") - 557);
- }
- }
- else if(eval("\x01") == 861)
- {
- set("\x01",eval("\x01") - 334);
- §§push(!§§pop());
- }
- else if(eval("\x01") == 238)
- {
- set("\x01",eval("\x01") + 334);
- }
- else if(eval("\x01") == 793)
- {
- set("\x01",eval("\x01") - 467);
- if(§§pop())
- {
- set("\x01",eval("\x01") + 262);
- }
- }
- else
- {
- if(eval("\x01") == 315)
- {
- set("\x01",eval("\x01") + 359);
- if(!_global.Game)
- {
- _global.Game extends MovieClip;
- var _loc2_ = _global.Game = function()
- {
- super();
- this.score = 0;
- this.loadLevels();
- this.soundFade = 800;
- }.prototype;
- _loc2_.startNextLevel = function()
- {
- this.message.hide();
- this.startLevel(this.levelIndex + 1);
- };
- _loc2_.loadLevels = function()
- {
- var game;
- var _loc5_ = undefined;
- var _loc4_ = undefined;
- var _loc3_ = undefined;
- if(Config.LEVELS_LOADFROMURL)
- {
- game = this;
- _loc5_ = new XML();
- _loc5_.ignoreWhite = true;
- _loc5_.onLoad = function(success)
- {
- game.finishedLoadingLevels(this.firstChild,success);
- };
- _loc5_.load(Config.LEVELS_URL);
- }
- else
- {
- this.levelInfos = new Array();
- _loc3_ = 0;
- while(_loc3_ < Config.LEVELS_INFOS.length)
- {
- _loc4_ = new LevelInfo();
- _loc4_.fillFromArray(Config.LEVELS_INFOS[_loc3_]);
- this.levelInfos.push(_loc4_);
- _loc3_ = _loc3_ + 1;
- }
- this.startLevel(_root.forcelevel);
- }
- };
- _loc2_.finishedLoadingLevels = function(rootNode, success)
- {
- var _loc2_ = undefined;
- var _loc3_ = undefined;
- if(!success)
- {
- this.gotoAndStop("loadFailed");
- return undefined;
- }
- this.levelInfos = new Array();
- _loc2_ = rootNode.firstChild;
- while(_loc2_)
- {
- if(_loc2_.nodeName == "LEVEL")
- {
- _loc3_ = new LevelInfo();
- _loc3_.fillFromNode(_loc2_);
- this.levelInfos.push(_loc3_);
- }
- _loc2_ = _loc2_.nextSibling;
- }
- this.startLevel(0);
- };
- _loc2_.startLevel = function(levelIndex)
- {
- this.levelIndex = levelIndex;
- this.levelName = this.levelInfos[levelIndex].name;
- this.createThings(this.levelInfos[levelIndex]);
- this.moveStepX = 0;
- this.moveStepY = 0;
- this.restartButton.onRelease = function()
- {
- _root.clickSound.start();
- this._parent.restartLevel();
- };
- this.backmenuButton.onRelease = function()
- {
- _root.bgmusic.setVolume(100);
- _root.bgmusic.stop();
- _root.clickSound.start();
- _root.gotoAndStop("title");
- };
- clearInterval(this.intervalID);
- this.intervalID = setInterval(this,"onPlayTime",1);
- this.gotoAndStop("play");
- };
- _loc2_.restartLevel = function()
- {
- this.startLevel(this.levelIndex);
- };
- _loc2_.createThings = function(levelInfo)
- {
- var _loc4_ = undefined;
- var _loc5_ = undefined;
- var _loc6_ = undefined;
- var _loc2_ = undefined;
- var _loc3_ = undefined;
- _loc2_ = 0;
- while(_loc2_ < this.things.length)
- {
- this.things[_loc2_].removeMovieClip();
- _loc2_ = _loc2_ + 1;
- }
- this.things = new Array();
- _loc2_ = 0;
- while(_loc2_ < this.inventoryKeys.length)
- {
- this.inventoryKeys[_loc2_].removeMovieClip();
- _loc2_ = _loc2_ + 1;
- }
- this.inventoryKeys = new Array();
- this.inventoryKeyIndexes = new Array();
- _loc2_ = 0;
- while(_loc2_ < levelInfo.typeInfos.length)
- {
- _loc3_ = 0;
- while(_loc3_ < levelInfo.typeInfos[_loc2_].length)
- {
- _loc4_ = levelInfo.typeInfos[_loc2_][_loc3_];
- if(_loc4_.type != TypeInfo.TYPE_OPEN)
- {
- switch(_loc4_.type)
- {
- case TypeInfo.TYPE_BLOCK:
- _loc5_ = this.createBlock(_loc2_,_loc3_,_loc4_.blockType);
- break;
- case TypeInfo.TYPE_PUSHBLOCK:
- _loc5_ = this.createPushBlock(_loc2_,_loc3_);
- break;
- case TypeInfo.TYPE_KEY:
- _loc5_ = this.createKey(_loc2_,_loc3_,_loc4_.keyButtonIndex);
- break;
- case TypeInfo.TYPE_BUTTON:
- _loc5_ = this.createButton(_loc2_,_loc3_,_loc4_.keyButtonIndex);
- break;
- case TypeInfo.TYPE_DOOR:
- _loc5_ = this.createDoor(_loc2_,_loc3_,_loc4_.doorType,_loc4_.doorDirection,_loc4_.keyButtonIndex);
- break;
- case TypeInfo.TYPE_MAN:
- _loc6_ = this.createMan(_loc2_,_loc3_);
- this.man = _loc6_;
- _loc5_ = _loc6_;
- break;
- case TypeInfo.TYPE_FLAG:
- _loc5_ = this.createFlag(_loc2_,_loc3_);
- }
- this.things.push(_loc5_);
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc2_ = _loc2_ + 1;
- }
- this.updateDepths();
- };
- _loc2_.createBlock = function(x, y, type)
- {
- var _loc2_ = this.thingsHolder.getNextHighestDepth();
- var _loc4_ = this.thingsHolder.attachMovie("block","thing" + _loc2_,_loc2_);
- var _loc3_ = _loc4_;
- _loc3_.initialize(x,y,type);
- return _loc3_;
- };
- _loc2_.createPushBlock = function(x, y)
- {
- var _loc2_ = this.thingsHolder.getNextHighestDepth();
- var _loc4_ = this.thingsHolder.attachMovie("pushBlock","thing" + _loc2_,_loc2_);
- var _loc3_ = _loc4_;
- _loc3_.initialize(x,y);
- return _loc3_;
- };
- _loc2_.createKey = function(x, y, keyIndex)
- {
- var _loc3_ = this.thingsHolder.getNextHighestDepth();
- var _loc4_ = this.thingsHolder.attachMovie("doorKey","thing" + _loc3_,_loc3_);
- var _loc2_ = _loc4_;
- _loc2_.initialize(x,y,keyIndex);
- return _loc2_;
- };
- _loc2_.createButton = function(x, y, buttonIndex)
- {
- var _loc2_ = this.thingsHolder.getNextHighestDepth();
- var _loc4_ = this.thingsHolder.attachMovie("doorButton","thing" + _loc2_,_loc2_);
- var _loc3_ = _loc4_;
- _loc3_.initialize(x,y,buttonIndex);
- return _loc3_;
- };
- _loc2_.createDoor = function(x, y, type, direction, keyButtonIndex)
- {
- var _loc2_ = this.thingsHolder.getNextHighestDepth();
- var _loc4_ = this.thingsHolder.attachMovie("door","thing" + _loc2_,_loc2_);
- var _loc3_ = _loc4_;
- _loc3_.initialize(x,y,type,direction,keyButtonIndex);
- return _loc3_;
- };
- _loc2_.createMan = function(x, y)
- {
- var _loc3_ = this.thingsHolder.getNextHighestDepth();
- var _loc4_ = this.thingsHolder.attachMovie("man","thing" + _loc3_,_loc3_);
- var _loc2_ = _loc4_;
- _loc2_.initialize(x,y);
- return _loc2_;
- };
- _loc2_.createFlag = function(x, y)
- {
- var _loc3_ = this.thingsHolder.getNextHighestDepth();
- var _loc4_ = this.thingsHolder.attachMovie("flag","thing" + _loc3_,_loc3_);
- var _loc2_ = _loc4_;
- _loc2_.initialize(x,y);
- return _loc2_;
- };
- _loc2_.onPlayTime = function()
- {
- var _loc7_ = getTimer();
- var _loc4_ = undefined;
- var _loc6_ = undefined;
- var _loc5_ = undefined;
- var _loc3_ = undefined;
- if(this.soundFade > 0)
- {
- this.soundFade = this.soundFade - 1;
- if(this.soundFade <= 50)
- {
- if(this.soundFade == 50)
- {
- _root.bgmusic.setVolume(100);
- }
- if(this.soundFade == 49)
- {
- _root.bgmusic.stop();
- }
- }
- else
- {
- _root.bgmusic.setVolume(Math.round(this.soundFade / 8));
- }
- }
- if(this.updateMoveDirections(_loc7_))
- {
- return undefined;
- }
- if(this.moveStepX == 0 && this.moveStepY == 0)
- {
- return undefined;
- }
- _loc4_ = (_loc7_ - this.startMoveTime) / Config.MAN_MOVETIME;
- if(_loc4_ <= 0)
- {
- return undefined;
- }
- if(_loc4_ > 1)
- {
- _loc4_ = 1;
- }
- _loc6_ = this.man.x + _loc4_ * this.moveStepX;
- _loc5_ = this.man.y + _loc4_ * this.moveStepY;
- this.man._x = _loc6_ * Config.DIRECTION_X[0] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[0] / Config.DIMENSION_Y;
- this.man._y = _loc6_ * Config.DIRECTION_X[1] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[1] / Config.DIMENSION_Y;
- _loc3_ = this.getPushingBlock(this.moveStepX,this.moveStepY);
- if(_loc3_ != null)
- {
- this.man.setPushing(true);
- _loc6_ = _loc3_.x + _loc4_ * this.moveStepX;
- _loc5_ = _loc3_.y + _loc4_ * this.moveStepY;
- _loc3_._x = _loc6_ * Config.DIRECTION_X[0] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[0] / Config.DIMENSION_Y;
- _loc3_._y = _loc6_ * Config.DIRECTION_X[1] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[1] / Config.DIMENSION_Y;
- }
- this.updateDepth(this.man);
- if(_loc3_)
- {
- this.updateDepth(_loc3_);
- }
- if(_loc4_ == 1)
- {
- this.man.x += this.moveStepX;
- this.man.y += this.moveStepY;
- if(_loc3_)
- {
- _loc3_.x += this.moveStepX;
- _loc3_.y += this.moveStepY;
- _root.boxSound.start();
- }
- this.man.setPushing(false);
- this.moveStepX = 0;
- this.moveStepY = 0;
- this.pickKey();
- if(this.updateDoors())
- {
- return undefined;
- }
- if(this.checkWin())
- {
- return undefined;
- }
- this.updateMoveDirections(_loc7_);
- this.onPlayTime();
- }
- updateAfterEvent();
- };
- _loc2_.updateMoveDirections = function(time)
- {
- if(this.moveStepX != 0 || this.moveStepY != 0)
- {
- return undefined;
- }
- if(Key.isDown(37))
- {
- if(this.setFaceDirection(-1,0))
- {
- return true;
- }
- if(!this.getCanMove(-1,0))
- {
- return false;
- }
- this.moveStepX = -1;
- this.moveStepY = 0;
- this.startMoveTime = time;
- }
- else if(Key.isDown(39))
- {
- if(this.setFaceDirection(1,0))
- {
- return true;
- }
- if(!this.getCanMove(1,0))
- {
- return false;
- }
- this.moveStepX = 1;
- this.moveStepY = 0;
- this.startMoveTime = time;
- }
- else if(Key.isDown(38))
- {
- if(this.setFaceDirection(0,-1))
- {
- return true;
- }
- if(!this.getCanMove(0,-1))
- {
- return false;
- }
- this.moveStepX = 0;
- this.moveStepY = -1;
- this.startMoveTime = time;
- }
- else if(Key.isDown(40))
- {
- if(this.setFaceDirection(0,1))
- {
- return true;
- }
- if(!this.getCanMove(0,1))
- {
- return false;
- }
- this.moveStepX = 0;
- this.moveStepY = 1;
- this.startMoveTime = time;
- }
- return false;
- };
- _loc2_.setFaceDirection = function(directionX, directionY)
- {
- var _loc4_ = this.getTileThings(this.man.x + directionX,this.man.y + directionY);
- var _loc5_ = undefined;
- var _loc3_ = undefined;
- this.man.setDirection(directionX,directionY);
- _loc3_ = 0;
- while(_loc3_ < _loc4_.length)
- {
- if(_loc4_[_loc3_].type == TypeInfo.TYPE_DOOR)
- {
- if(_loc4_[_loc3_].doorType == TypeInfo.DOORTYPE_KEY)
- {
- _loc5_ = this.getInventoryIndex(_loc4_[_loc3_].keyButtonIndex);
- if(_loc5_ != -1)
- {
- if(!_loc4_[_loc3_].opened)
- {
- this.removeKeyFromInventory(_loc5_);
- _loc4_[_loc3_].opened = true;
- _root.doorSound.start();
- this.openingDoors = new Array();
- this.closingDoors = new Array();
- this.openingDoors.push(_loc4_[_loc3_]);
- clearInterval(this.intervalID);
- this.startDoorTime = getTimer();
- this.intervalID = setInterval(this,"onDoorTime",1);
- return true;
- }
- }
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- return false;
- };
- _loc2_.getInventoryIndex = function(keyIndex)
- {
- var _loc2_ = undefined;
- _loc2_ = 0;
- while(_loc2_ < this.inventoryKeyIndexes.length)
- {
- if(this.inventoryKeyIndexes[_loc2_] == keyIndex)
- {
- return _loc2_;
- }
- _loc2_ = _loc2_ + 1;
- }
- return -1;
- };
- _loc2_.getCanMove = function(directionX, directionY)
- {
- var _loc2_ = undefined;
- var _loc6_ = this.man.x + directionX;
- var _loc5_ = this.man.y + directionY;
- var _loc4_ = false;
- var _loc3_ = undefined;
- while(true)
- {
- if(_loc6_ < 0 || _loc6_ >= Config.DIMENSION_X || _loc5_ < 0 || _loc5_ >= Config.DIMENSION_Y)
- {
- return false;
- }
- _loc2_ = this.getTileThings(_loc6_,_loc5_);
- if(_loc2_.length == 0)
- {
- return true;
- }
- _loc3_ = 0;
- while(_loc3_ < _loc2_.length)
- {
- switch(_loc2_[_loc3_].type)
- {
- case TypeInfo.TYPE_KEY:
- case TypeInfo.TYPE_BUTTON:
- case TypeInfo.TYPE_FLAG:
- if(_loc2_.length == 1)
- {
- return true;
- }
- break;
- case TypeInfo.TYPE_BLOCK:
- return false;
- default:
- if(_loc0_ !== TypeInfo.TYPE_PUSHBLOCK)
- {
- if(_loc0_ === TypeInfo.TYPE_DOOR)
- {
- if(!_loc2_[_loc3_].opened)
- {
- return false;
- }
- if(_loc2_.length == 1)
- {
- return true;
- }
- }
- }
- else
- {
- if(_loc4_)
- {
- return false;
- }
- _loc4_ = true;
- }
- break;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc6_ += directionX;
- _loc5_ += directionY;
- }
- };
- _loc2_.getTileThings = function(x, y)
- {
- var _loc3_ = new Array();
- var _loc2_ = undefined;
- _loc2_ = 0;
- while(_loc2_ < this.things.length)
- {
- if(this.things[_loc2_].x == x && this.things[_loc2_].y == y)
- {
- _loc3_.push(this.things[_loc2_]);
- }
- _loc2_ = _loc2_ + 1;
- }
- return _loc3_;
- };
- _loc2_.getPushingBlock = function(directionX, directionY)
- {
- var _loc3_ = this.getTileThings(this.man.x + directionX,this.man.y + directionY);
- var _loc2_ = undefined;
- _loc2_ = 0;
- while(_loc2_ < _loc3_.length)
- {
- if(_loc3_[_loc2_].type == TypeInfo.TYPE_PUSHBLOCK)
- {
- return _loc3_[_loc2_];
- }
- _loc2_ = _loc2_ + 1;
- }
- return null;
- };
- _loc2_.updateDepth = function(thing)
- {
- var _loc4_ = undefined;
- var _loc2_ = undefined;
- if(thing.index > 0 && Thing.compareDepths(thing,this.things[thing.index - 1]) == -1)
- {
- _loc4_ = this.findDepthIndex(thing,0,thing.index);
- this.things.splice(thing.index,1);
- this.things.splice(_loc4_,0,thing);
- }
- else
- {
- if(!(thing.index < this.things.length - 1 && Thing.compareDepths(thing,this.things[thing.index + 1]) == 1))
- {
- return undefined;
- }
- _loc4_ = this.findDepthIndex(thing,thing.index + 1,this.things.length);
- this.things.splice(_loc4_,0,thing);
- this.things.splice(thing.index,1);
- }
- _loc2_ = 0;
- while(_loc2_ < this.things.length)
- {
- this.things[_loc2_].index = _loc2_;
- this.things[_loc2_].swapDepths(_loc2_);
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.updateDepths = function()
- {
- var _loc2_ = undefined;
- this.things.sort(Thing.compareDepths);
- _loc2_ = 0;
- while(_loc2_ < this.things.length)
- {
- this.things[_loc2_].index = _loc2_;
- this.things[_loc2_].swapDepths(_loc2_);
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.findDepthIndex = function(thing, begin, end)
- {
- var _loc2_ = undefined;
- var _loc5_ = undefined;
- while(begin < end)
- {
- _loc2_ = Math.floor((begin + end) / 2);
- _loc5_ = Thing.compareDepths(thing,this.things[_loc2_]);
- if(_loc5_ == -1)
- {
- end = _loc2_;
- }
- else
- {
- begin = _loc2_ + 1;
- }
- }
- return end;
- };
- _loc2_.pickKey = function()
- {
- var _loc2_ = undefined;
- var _loc3_ = undefined;
- _loc2_ = 0;
- while(_loc2_ < this.things.length)
- {
- if(!(this.things[_loc2_].x != this.man.x || this.things[_loc2_].y != this.man.y))
- {
- if(this.things[_loc2_].type == TypeInfo.TYPE_KEY)
- {
- this.addKeyToInventory(this.things[_loc2_].keyIndex);
- this.things[_loc2_].removeMovieClip();
- this.things.splice(_loc2_,1);
- _loc3_ = _loc2_;
- while(_loc3_ < this.things.length)
- {
- this.things[_loc3_].index = _loc3_;
- _loc3_ = _loc3_ + 1;
- }
- _loc2_ = _loc2_ - 1;
- }
- }
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.addKeyToInventory = function(keyIndex)
- {
- var _loc4_ = this.inventoryHolder.getNextHighestDepth();
- var _loc3_ = this.inventoryHolder.attachMovie("inventoryKey","key" + _loc4_,_loc4_);
- new Color(_loc3_).setRGB(Config.KEY_COLOURS[keyIndex]);
- _loc3_._x = this.inventoryKeys.length * Config.INVENTORY_KEYSPACING;
- this.inventoryKeys.push(_loc3_);
- this.inventoryKeyIndexes.push(keyIndex);
- _root.pickupSound.start();
- };
- _loc2_.removeKeyFromInventory = function(index)
- {
- var _loc2_ = undefined;
- this.inventoryKeys[index].removeMovieClip();
- this.inventoryKeys.splice(index,1);
- this.inventoryKeyIndexes.splice(index,1);
- _loc2_ = index;
- while(_loc2_ < this.inventoryKeys.length)
- {
- this.inventoryKeys[_loc2_]._x = _loc2_ * Config.INVENTORY_KEYSPACING;
- _loc2_ = _loc2_ + 1;
- }
- };
- _loc2_.updateDoors = function()
- {
- var _loc3_ = undefined;
- this.openingDoors = new Array();
- this.closingDoors = new Array();
- _loc3_ = 0;
- while(_loc3_ < this.things.length)
- {
- if(this.things[_loc3_].type == TypeInfo.TYPE_DOOR)
- {
- if(this.things[_loc3_].doorType == TypeInfo.DOORTYPE_BUTTON)
- {
- if(this.things[_loc3_].opened)
- {
- if(!this.getDoorShouldBeOpen(this.things[_loc3_]))
- {
- this.closingDoors.push(this.things[_loc3_]);
- _root.doorSound.start();
- }
- }
- else if(this.getDoorShouldBeOpen(this.things[_loc3_]))
- {
- this.openingDoors.push(this.things[_loc3_]);
- _root.doorSound.start();
- }
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- if(this.openingDoors.length > 0 || this.closingDoors.length > 0)
- {
- clearInterval(this.intervalID);
- this.startDoorTime = getTimer();
- this.intervalID = setInterval(this,"onDoorTime",1);
- return true;
- }
- return false;
- };
- _loc2_.getDoorShouldBeOpen = function(door)
- {
- var _loc3_ = undefined;
- var _loc2_ = undefined;
- if(door.opened)
- {
- _loc2_ = 0;
- while(_loc2_ < this.things.length)
- {
- if(this.things[_loc2_] != door)
- {
- if(this.things[_loc2_].x == door.x && this.things[_loc2_].y == door.y)
- {
- return true;
- }
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- _loc2_ = 0;
- while(true)
- {
- if(_loc2_ < this.things.length)
- {
- if(this.things[_loc2_].type == TypeInfo.TYPE_BUTTON)
- {
- if(this.things[_loc2_].buttonIndex == door.keyButtonIndex)
- {
- _loc3_ = 0;
- while(_loc3_ < this.things.length)
- {
- if(_loc3_ != _loc2_)
- {
- if(this.things[_loc3_].x == this.things[_loc2_].x && this.things[_loc3_].y == this.things[_loc2_].y)
- {
- break;
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- if(_loc3_ >= this.things.length)
- {
- break;
- }
- }
- }
- }
- else
- {
- return true;
- }
- _loc2_ = _loc2_ + 1;
- }
- return false;
- };
- _loc2_.onDoorTime = function()
- {
- var _loc4_ = getTimer();
- var _loc3_ = (_loc4_ - this.startDoorTime) / Config.DOOR_MOVETIME;
- var _loc2_ = undefined;
- if(_loc3_ > 1)
- {
- _loc3_ = 1;
- }
- _loc2_ = 0;
- while(_loc2_ < this.openingDoors.length)
- {
- this.openingDoors[_loc2_].setCloseRatio(1 - _loc3_);
- this.updateDepth(this.openingDoors[_loc2_]);
- _loc2_ = _loc2_ + 1;
- }
- _loc2_ = 0;
- while(_loc2_ < this.closingDoors.length)
- {
- this.closingDoors[_loc2_].setCloseRatio(_loc3_);
- this.updateDepth(this.closingDoors[_loc2_]);
- _loc2_ = _loc2_ + 1;
- }
- if(_loc3_ == 1)
- {
- clearInterval(this.intervalID);
- this.intervalID = setInterval(this,"onPlayTime",1);
- }
- updateAfterEvent();
- };
- _loc2_.checkWin = function()
- {
- var _loc4_ = this.getTileThings(this.man.x,this.man.y);
- var _loc3_ = undefined;
- _loc3_ = 0;
- while(_loc3_ < _loc4_.length)
- {
- if(_loc4_[_loc3_].type == TypeInfo.TYPE_FLAG)
- {
- this.score += this.levelInfos[this.levelIndex].score;
- clearInterval(this.intervalID);
- if(this.levelIndex < this.levelInfos.length - 1)
- {
- this.message.showClear(this.levelIndex);
- _root.clearSound.start();
- }
- else
- {
- this.message.showWin();
- _root.bgmusic.start();
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- return false;
- };
- §§push(ASSetPropFlags(_global.Game.prototype,null,1));
- }
- §§pop();
- break loop0;
- }
- if(eval("\x01") == 572)
- {
- set("\x01",eval("\x01") + 221);
- §§push(true);
- }
- else if(eval("\x01") == 671)
- {
- set("\x01",eval("\x01") - 356);
- }
- else if(eval("\x01") == 825)
- {
- set("\x01",eval("\x01") + 154);
- }
- else if(eval("\x01") == 743)
- {
- set("\x01",eval("\x01") - 171);
- }
- else if(eval("\x01") == 71)
- {
- set("\x01",eval("\x01") + 805);
- §§push(true);
- }
- else if(eval("\x01") == 347)
- {
- set("\x01",eval("\x01") - 276);
- }
- else if(eval("\x01") == 876)
- {
- set("\x01",eval("\x01") + 52);
- if(§§pop())
- {
- set("\x01",eval("\x01") + 56);
- }
- }
- else if(eval("\x01") == 527)
- {
- set("\x01",eval("\x01") + 144);
- if(§§pop())
- {
- set("\x01",eval("\x01") - 356);
- }
- }
- else if(eval("\x01") == 984)
- {
- set("\x01",eval("\x01") - 5);
- }
- else
- {
- if(eval("\x01") != 670)
- {
- break;
- }
- set("\x01",eval("\x01") - 299);
- §§push("\x0f");
- }
- }
- }
- }
- }
- }
- }
-